package Expe7;

import java.util.Scanner;

/**
 * @Author sy
 * @Date 2022/10/4
 */
public class T1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Circle circle = new Circle();

        System.out.println("请输入底面圆的半径：");
        circle.radius = in.nextDouble();;

        Circular circular = new Circular();
        circular.setBottom(circle);

        System.out.println("请输入该圆锥的高：");
        double h = in.nextDouble();
        circular.setHeight(h);

        System.out.println("圆锥的体积："+circular.getVolme());
    }
}
class Circle {
    double radius;

    double getA() {
        //圆的面积
        double A = Math.PI * radius * radius;
        return A;
    }
}
class Circular {
    Circle bottom;
    double height;
    void setBottom(Circle c){
        bottom = c;
    }
    void setHeight(double h){
        height=h;
    }
    double getVolme(){
        return bottom.getA()*height/3.0;
    }
}
